#ifndef __SXE_COMPAT_RHEL_H__
#define __SXE_COMPAT_RHEL_H__

#if !RHEL_RELEASE_CODE
#error "RHEL_RELEASE_CODE is 0 or undefined"
#endif

#ifndef RHEL_RELEASE_VERSION
#error "RHEL_RELEASE_VERSION is undefined"
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(7,6))  
#ifndef NETIF_F_GSO_IPXIP4
#define NETIF_F_GSO_IPXIP4 0
#endif
#ifndef NETIF_F_GSO_IPXIP6
#define NETIF_F_GSO_IPXIP6 0
#endif
#define HAVE_RHEL7_GSO_FEATURE
#define DCBNL_OPS_GETAPP_RETURN_U8
#define HAVE_DMA_ATTRS_STRUCT
#define HAVE_NET_DEVICE_EXTENDED
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define NEED_SKB_FRAG_SIZE_API
#define NEED_BOOTTIME_SECONDS
#define HAVE_NDO_SET_VF_LINK_STATE

#define netdev_xmit_more()	(skb->xmit_more)
#define NOT_INCLUDE_SCTP_H
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(7,7))   
#ifndef NETIF_F_GSO_IPXIP4
#define NETIF_F_GSO_IPXIP4 0
#endif
#ifndef NETIF_F_GSO_IPXIP6
#define NETIF_F_GSO_IPXIP6 0
#endif
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_RHEL7_GSO_FEATURE
#define DCBNL_OPS_GETAPP_RETURN_U8
#define HAVE_DMA_ATTRS_STRUCT
#define HAVE_NET_DEVICE_EXTENDED
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define NEED_SKB_FRAG_SIZE_API
#define NEED_BOOTTIME_SECONDS
#define HAVE_NDO_SET_VF_LINK_STATE

#define netdev_xmit_more()	(skb->xmit_more)
#define NOT_INCLUDE_SCTP_H
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(7,8))   
#ifndef NETIF_F_GSO_IPXIP4
#define NETIF_F_GSO_IPXIP4 0
#endif
#ifndef NETIF_F_GSO_IPXIP6
#define NETIF_F_GSO_IPXIP6 0
#endif
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_RHEL7_GSO_FEATURE
#define DCBNL_OPS_GETAPP_RETURN_U8
#define HAVE_DMA_ATTRS_STRUCT
#define HAVE_NET_DEVICE_EXTENDED
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define NEED_SKB_FRAG_SIZE_API
#define NEED_BOOTTIME_SECONDS
#define HAVE_NDO_SET_VF_LINK_STATE

#define netdev_xmit_more()	(skb->xmit_more)
#define NOT_INCLUDE_SCTP_H
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(7,9))  
#ifndef NETIF_F_GSO_IPXIP4
#define NETIF_F_GSO_IPXIP4 0
#endif
#ifndef NETIF_F_GSO_IPXIP6
#define NETIF_F_GSO_IPXIP6 0
#endif
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_RHEL7_GSO_FEATURE
#define DCBNL_OPS_GETAPP_RETURN_U8
#define HAVE_DMA_ATTRS_STRUCT
#define HAVE_NET_DEVICE_EXTENDED
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define NEED_SKB_FRAG_SIZE_API
#define NEED_BOOTTIME_SECONDS
#define HAVE_NDO_SET_VF_LINK_STATE

#define netdev_xmit_more()	(skb->xmit_more)

#define NOT_INCLUDE_SCTP_H
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,0))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_QUERY_PROG
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define HAVE_NDO_SET_VF_LINK_STATE
#define NDO_SET_FEATURES_RTN_0
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define netdev_xmit_more()	(skb->xmit_more)
#define xdp_convert_buff_to_frame convert_to_xdp_frame
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,1))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_AF_XDP_ZERO_COPY
#define XSK_UMEM_CONSUME_TX_NEED_3_PARAMS
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_QUERY_PROG
#define ETH_GET_HEADLEN_API_NEED_2_PARAM
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define NEED_SKB_FRAG_OFF_API
#define NEED_SKB_FRAG_OFF_ADD_API
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define netdev_xmit_more()	(skb->xmit_more)
#define XDP_SETUP_XSK_POOL XDP_SETUP_XSK_UMEM
#define xdp_convert_buff_to_frame convert_to_xdp_frame
#define xsk_tx_release xsk_umem_consume_tx_done
#define xsk_tx_completed xsk_umem_complete_tx
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,2))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_QUERY_PROG
#define HAVE_AF_XDP_ZERO_COPY
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define XDP_SETUP_XSK_POOL XDP_SETUP_XSK_UMEM
#define xdp_convert_buff_to_frame convert_to_xdp_frame
#define xsk_tx_release xsk_umem_consume_tx_done
#define xsk_tx_completed xsk_umem_complete_tx
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,3))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_AF_XDP_ZERO_COPY
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_XDP_QUERY_PROG
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define XDP_SETUP_XSK_POOL XDP_SETUP_XSK_UMEM
#define xdp_convert_buff_to_frame convert_to_xdp_frame
#define xsk_umem_discard_addr xsk_umem_release_addr
#define xsk_umem_discard_addr_rq xsk_umem_release_addr_rq
#define xsk_pool_get_rx_frame_size xsk_umem_get_rx_frame_size
#define xsk_pool_set_rxq_info xsk_buff_set_rxq_info
#define xsk_pool_dma_map xsk_buff_dma_map
#define xsk_pool_dma_unmap xsk_buff_dma_unmap
#define xsk_uses_need_wakeup xsk_umem_uses_need_wakeup
#define xsk_tx_peek_desc xsk_umem_consume_tx
#define xsk_tx_release xsk_umem_consume_tx_done
#define xsk_tx_completed xsk_umem_complete_tx
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,4))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_AF_XDP_ZERO_COPY
#define XDP_RXQ_INFO_REQ_API_NEED_3_PARAMS
#define XSK_BUFF_DMA_SYNC_API_NEED_1_PARAM
#define XDP_XMIT_FRAME_FAILED_NEED_FREE
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT

#define XDP_SETUP_XSK_POOL XDP_SETUP_XSK_UMEM
#define xsk_pool_get_rx_frame_size xsk_umem_get_rx_frame_size
#define xsk_pool_set_rxq_info xsk_buff_set_rxq_info
#define xsk_pool_dma_map xsk_buff_dma_map
#define xsk_pool_dma_unmap xsk_buff_dma_unmap
#define xsk_uses_need_wakeup xsk_umem_uses_need_wakeup
#define xsk_tx_peek_desc xsk_umem_consume_tx
#define xsk_tx_release xsk_umem_consume_tx_done
#define xsk_tx_completed xsk_umem_complete_tx
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,5))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,6))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_ETHTOOL_COALESCE_EXTACK
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(8,7))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_ETHTOOL_COALESCE_EXTACK
#define HAVE_ETHTOOL_EXTENDED_RINGPARAMS
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_SET_VF_LINK_STATE
#define BPF_WARN_INVALID_XDP_ACTION_API_NEED_3_PARAMS
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(9,0))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_ETH_IOCTL
#define HAVE_NDO_SET_VF_LINK_STATE
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(9,1))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_ETHTOOL_COALESCE_EXTACK
#define HAVE_ETHTOOL_EXTENDED_RINGPARAMS
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_ETH_IOCTL
#define HAVE_NDO_SET_VF_LINK_STATE
#define BPF_WARN_INVALID_XDP_ACTION_API_NEED_3_PARAMS
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#if (RHEL_RELEASE_CODE == RHEL_RELEASE_VERSION(9,2))  
#define HAVE_XDP_SUPPORT
#define HAVE_XDP_BUFF_DATA_META
#define HAVE_MEM_TYPE_XSK_BUFF_POOL
#define HAVE_NETDEV_BPF_XSK_BUFF_POOL
#define HAVE_AF_XDP_ZERO_COPY
#define HAVE_XDP_BUFF_FRAME_SIZE
#define HAVE_XDP_BUFF_INIT_API
#define HAVE_XDP_PREPARE_BUFF_API
#define HAVE_SKB_CSUM_SCTP_API
#define HAVE_ETHTOOL_COALESCE_EXTACK
#define HAVE_ETHTOOL_EXTENDED_RINGPARAMS
#define HAVE_NETDEV_NESTED_PRIV
#define HAVE_TIMEOUT_TXQUEUE_IDX
#define HAVE_NET_PREFETCH_API
#define HAVE_DEV_PAGE_IS_REUSABLE_API
#define HAVE_NDO_XSK_WAKEUP
#define HAVE_NDO_FDB_ADD_EXTACK
#define HAVE_NDO_BRIDGE_SETLINK_EXTACK
#define HAVE_NDO_ETH_IOCTL
#define HAVE_NDO_SET_VF_LINK_STATE
#define BPF_WARN_INVALID_XDP_ACTION_API_NEED_3_PARAMS
#define NETIF_NAPI_ADD_API_NEED_3_PARAMS
#define HAVE_MACVLAN_OFFLOAD_SUPPORT
#define SXE_KERNEL_MATCHED
#endif

#endif 
